org.eclipse.vtp.framework.interactions.core.commands
Class SelectionRequestCommand

java.lang.Object
  extended by org.eclipse.vtp.framework.interactions.core.commands.ConversationCommand
      extended by org.eclipse.vtp.framework.interactions.core.commands.SelectionRequestCommand
All Implemented Interfaces:
ICommand

public final class SelectionRequestCommand
extends ConversationCommand

A command that accepts a selection from the user.

Author:
Lonnie Pryor

Field Summary
 
Fields inherited from class org.eclipse.vtp.framework.interactions.core.commands.ConversationCommand
INPUT_TYPE_CUSTOM, INPUT_TYPE_FILE, OUTPUT_TYPE_FILE, OUTPUT_TYPE_TEXT
 
Constructor Summary
SelectionRequestCommand()
          Creates a new InputRequestCommand.
 
Method Summary
 void addFileOutput(java.lang.String path)
          Adds a file output item to this selection request.
 void addOption(java.lang.String optionName)
          Adds an option to this selection request.
 void addOptionFileOutput(int optionIndex, java.lang.String path)
          Adds a file output item to this selection request.
 void addOptionTextOutput(int optionIndex, java.lang.String text)
          Adds a text output item to this selection request.
 void addTextOutput(java.lang.String text)
          Adds a text output item to this selection request.
 java.lang.Object exportContents()
          Exports the contents of this command to a simple structure of arrays and serializable values from java.lang.
 java.lang.String getFilledResultValue()
          Returns the value of the result parameter to pass if the input is valid.
 java.lang.String getNoInputResultValue()
          Returns the value of the result parameter to pass if the input is missing.
 java.lang.String getNoMatchResultValue()
          Returns the value of the result parameter to pass if the input is invalid.
 java.lang.String getOption(int optionIndex)
          Returns the name of the option at the specified index.
 int getOptionCount()
          Returns the number of options configured in this selection request.
 int getOptionInputType(int optionIndex)
          Returns the type of the input descriptor for the option at the specified index.
 java.lang.String getOptionInputValue(int optionIndex)
          Returns the value of the input descriptor for the option at the specified index.
 int getOptionOutputCount(int optionIndex)
          Returns the number of output elements configured in this selection request option.
 int getOptionOutputType(int optionIndex, int optionOutputIndex)
          Returns the type of the output at the supplied output index for the option at the specified index.
 java.lang.String getOptionOutputValue(int optionIndex, int optionOutputIndex)
          Returns the value of the output at the supplied output index for the option at the specified index.
 java.lang.String getOptionProperty(int optionIndex, java.lang.String key)
          Returns a property value of the option at the specified index.
 int getOutputCount()
          Returns the number of output elements configured in this selection request.
 int getOutputType(int outputIndex)
          Returns the type of the output at the specified index.
 java.lang.String getOutputValue(int outputIndex)
          Returns the value of the output at the specified index.
 java.lang.String[] getParameterNames()
          Returns the names of the parameters that will be returned from the interaction.
 java.lang.String[] getParameterValues(java.lang.String name)
          Returns the values of a parameter to be set when the process resumes.
 java.lang.String[] getPropertyNames()
          Returns the names of the properties of the interaction.
 java.lang.String getPropertyValue(java.lang.String name)
          Returns the value of a property of the interaction.
 java.lang.String getResultName()
          Returns the name of the parameter to pass the result of the request as.
 java.lang.String getSelectionName()
          Returns the name of the parameter to pass the provided input as.
 void importContents(java.lang.Object contents)
          Configures the contents of this command with a structure previously returned from ICommand.exportContents().
 void insertFileOutput(int outputIndex, java.lang.String path)
          Adds a file output item to this selection request at the specified index.
 void insertOption(int optionIndex, java.lang.String optionName)
          Inserts an option into this selection request at the specified index..
 void insertOptionFileOutput(int optionIndex, int optionOutputIndex, java.lang.String path)
          Adds a file output item to this selection request at the specified index.
 void insertOptionTextOutput(int optionIndex, int optionOutputIndex, java.lang.String text)
          Adds a text output item to this selection request at the specified index.
 void insertTextOutput(int outputIndex, java.lang.String text)
          Adds a text output item to this selection request at the specified index.
 void removeOption(int optionIndex)
          Removes the option in this selection request at the specified index.
 void removeOptionOutput(int optionIndex, int optionOutputIndex)
          Removes the output item in this selection request at the specified index.
 void removeOutput(int outputIndex)
          Removes the output item in this selection request at the specified index.
 void setFileOutput(int outputIndex, java.lang.String path)
          Sets the file output item in this selection request at the specified index.
 void setFilledResultValue(java.lang.String filledResultValue)
          Sets the value of the result parameter to pass if the input is valid.
 void setNoInputResultValue(java.lang.String noInputResultValue)
          Sets the value of the result parameter to pass if the input is missing.
 void setNoMatchResultValue(java.lang.String noMatchResultValue)
          Sets the value of the result parameter to pass if the input is invalid.
 void setOption(int optionIndex, java.lang.String optionName)
          Sets an option in this selection request at the specified index..
 void setOptionCustomInput(int optionIndex, java.lang.String customData)
          Sets a custom input descriptor for the option at the specified index.
 void setOptionFileInput(int optionIndex, java.lang.String path)
          Sets the input descriptor to a resource at the specified path for the option at the specified index.
 void setOptionFileOutput(int optionIndex, int optionOutputIndex, java.lang.String path)
          Sets the file output item in this selection request at the specified index.
 void setOptionProperty(int optionIndex, java.lang.String key, java.lang.String value)
          Sets a property value of the option at the specified index.
 void setOptionTextOutput(int optionIndex, int optionOutputIndex, java.lang.String text)
          Sets the text output item in this selection request at the specified index.
 void setParameterValues(java.lang.String name, java.lang.String[] values)
          Configures a parameter set when the current process resumes.
 void setPropertyValue(java.lang.String name, java.lang.String value)
          Configures a property of the interaction.
 void setResultName(java.lang.String resultName)
          Sets the name of the parameter to pass the result of the request as.
 void setSelectionName(java.lang.String inputName)
          Sets the name of the parameter to pass the provided input as.
 void setTextOutput(int outputIndex, java.lang.String text)
          Sets the text output item in this selection request at the specified index.
 
Methods inherited from class org.eclipse.vtp.framework.interactions.core.commands.ConversationCommand
accept
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectionRequestCommand

public SelectionRequestCommand()
Creates a new InputRequestCommand.

Method Detail

getSelectionName

public java.lang.String getSelectionName()
Returns the name of the parameter to pass the provided input as.

Returns:
The name of the parameter to pass the provided input as.

setSelectionName

public void setSelectionName(java.lang.String inputName)
Sets the name of the parameter to pass the provided input as.

Parameters:
inputName - The name of the parameter to pass the provided input as.

getResultName

public java.lang.String getResultName()
Returns the name of the parameter to pass the result of the request as.

Returns:
The name of the parameter to pass the result of the request as.

setResultName

public void setResultName(java.lang.String resultName)
Sets the name of the parameter to pass the result of the request as.

Parameters:
resultName - The name of the parameter to pass the result of the request as.

getFilledResultValue

public java.lang.String getFilledResultValue()
Returns the value of the result parameter to pass if the input is valid.

Returns:
The value of the result parameter to pass if the input is valid.

setFilledResultValue

public void setFilledResultValue(java.lang.String filledResultValue)
Sets the value of the result parameter to pass if the input is valid.

Parameters:
filledResultValue - The value of the result parameter to pass if the input is valid.

getNoInputResultValue

public java.lang.String getNoInputResultValue()
Returns the value of the result parameter to pass if the input is missing.

Returns:
The value of the result parameter to pass if the input is missing.

setNoInputResultValue

public void setNoInputResultValue(java.lang.String noInputResultValue)
Sets the value of the result parameter to pass if the input is missing.

Parameters:
noInputResultValue - The value of the result parameter to pass if the input is missing.

getNoMatchResultValue

public java.lang.String getNoMatchResultValue()
Returns the value of the result parameter to pass if the input is invalid.

Returns:
The value of the result parameter to pass if the input is invalid.

setNoMatchResultValue

public void setNoMatchResultValue(java.lang.String noMatchResultValue)
Sets the value of the result parameter to pass if the input is invalid.

Parameters:
noMatchResultValue - The value of the result parameter to pass if the input is invalid.

getPropertyNames

public java.lang.String[] getPropertyNames()
Returns the names of the properties of the interaction.

Returns:
The names of the properties of the interaction.

getPropertyValue

public java.lang.String getPropertyValue(java.lang.String name)
Returns the value of a property of the interaction.

Parameters:
name - The name of the property to be set.
Returns:
The value that the specified property will be set to.

setPropertyValue

public void setPropertyValue(java.lang.String name,
                             java.lang.String value)
Configures a property of the interaction.

Parameters:
name - The name of the property to set.
value - The value to set the property to.

getOutputCount

public int getOutputCount()
Returns the number of output elements configured in this selection request.

Returns:
The number of output elements configured in this selection request.

getOutputType

public int getOutputType(int outputIndex)
Returns the type of the output at the specified index.

Parameters:
outputIndex - The index to check.
Returns:
The type of the output at the specified index.

getOutputValue

public java.lang.String getOutputValue(int outputIndex)
Returns the value of the output at the specified index.

Parameters:
outputIndex - The index to check.
Returns:
The value of the output at the specified index.

addFileOutput

public void addFileOutput(java.lang.String path)
Adds a file output item to this selection request.

Parameters:
path - The path of the file to render.

addTextOutput

public void addTextOutput(java.lang.String text)
Adds a text output item to this selection request.

Parameters:
text - The text to render.

insertFileOutput

public void insertFileOutput(int outputIndex,
                             java.lang.String path)
Adds a file output item to this selection request at the specified index.

Parameters:
outputIndex - The index to insert at.
path - The path of the file to render.

insertTextOutput

public void insertTextOutput(int outputIndex,
                             java.lang.String text)
Adds a text output item to this selection request at the specified index.

Parameters:
outputIndex - The index to insert at.
text - The text to render.

setFileOutput

public void setFileOutput(int outputIndex,
                          java.lang.String path)
Sets the file output item in this selection request at the specified index.

Parameters:
outputIndex - The index to set at.
path - The path of the file to render.

setTextOutput

public void setTextOutput(int outputIndex,
                          java.lang.String text)
Sets the text output item in this selection request at the specified index.

Parameters:
outputIndex - The index to set at.
text - The text to render.

removeOutput

public void removeOutput(int outputIndex)
Removes the output item in this selection request at the specified index.

Parameters:
outputIndex - The index to remove at.

getOptionCount

public int getOptionCount()
Returns the number of options configured in this selection request.

Returns:
The number of options configured in this selection request.

getOption

public java.lang.String getOption(int optionIndex)
Returns the name of the option at the specified index.

Parameters:
optionIndex - The index to check.
Returns:
The name of the option at the specified index.

addOption

public void addOption(java.lang.String optionName)
Adds an option to this selection request.

Parameters:
optionName - The name of the option to add.

insertOption

public void insertOption(int optionIndex,
                         java.lang.String optionName)
Inserts an option into this selection request at the specified index..

Parameters:
optionIndex - The index to insert at.
optionName - The name of the option to insert.

setOption

public void setOption(int optionIndex,
                      java.lang.String optionName)
Sets an option in this selection request at the specified index..

Parameters:
optionIndex - The index to set at.
optionName - The name of the option to set.

removeOption

public void removeOption(int optionIndex)
Removes the option in this selection request at the specified index.

Parameters:
optionIndex - The index to remove at.

getOptionOutputCount

public int getOptionOutputCount(int optionIndex)
Returns the number of output elements configured in this selection request option.

Parameters:
optionIndex - The index to check.
Returns:
The number of output elements configured in this selection request option.

getOptionOutputType

public int getOptionOutputType(int optionIndex,
                               int optionOutputIndex)
Returns the type of the output at the supplied output index for the option at the specified index.

Parameters:
optionIndex - The option index to check.
optionOutputIndex - The output index to check.
Returns:
The type of the output at the supplied output index for the option at the specified index.

getOptionOutputValue

public java.lang.String getOptionOutputValue(int optionIndex,
                                             int optionOutputIndex)
Returns the value of the output at the supplied output index for the option at the specified index.

Parameters:
optionIndex - The option index to check.
optionOutputIndex - The output index to check.
Returns:
The value of the output at the supplied output index for the option at the specified index.

addOptionFileOutput

public void addOptionFileOutput(int optionIndex,
                                java.lang.String path)
Adds a file output item to this selection request.

Parameters:
optionIndex - The option index to modify.
path - The path of the file to render.

addOptionTextOutput

public void addOptionTextOutput(int optionIndex,
                                java.lang.String text)
Adds a text output item to this selection request.

Parameters:
optionIndex - The option index to modify.
text - The text to render.

insertOptionFileOutput

public void insertOptionFileOutput(int optionIndex,
                                   int optionOutputIndex,
                                   java.lang.String path)
Adds a file output item to this selection request at the specified index.

Parameters:
optionIndex - The option index to modify.
optionOutputIndex - The index to insert at.
path - The path of the file to render.

insertOptionTextOutput

public void insertOptionTextOutput(int optionIndex,
                                   int optionOutputIndex,
                                   java.lang.String text)
Adds a text output item to this selection request at the specified index.

Parameters:
optionIndex - The option index to modify.
optionOutputIndex - The index to insert at.
text - The text to render.

setOptionFileOutput

public void setOptionFileOutput(int optionIndex,
                                int optionOutputIndex,
                                java.lang.String path)
Sets the file output item in this selection request at the specified index.

Parameters:
optionIndex - The option index to modify.
optionOutputIndex - The index to set at.
path - The path of the file to render.

setOptionTextOutput

public void setOptionTextOutput(int optionIndex,
                                int optionOutputIndex,
                                java.lang.String text)
Sets the text output item in this selection request at the specified index.

Parameters:
optionIndex - The option index to modify.
optionOutputIndex - The index to set at.
text - The text to render.

removeOptionOutput

public void removeOptionOutput(int optionIndex,
                               int optionOutputIndex)
Removes the output item in this selection request at the specified index.

Parameters:
optionIndex - The option index to modify.
optionOutputIndex - The index to remove at.

getOptionProperty

public java.lang.String getOptionProperty(int optionIndex,
                                          java.lang.String key)
Returns a property value of the option at the specified index.

Parameters:
optionIndex - The index to check.
key - The property key.
Returns:
The key of the option at the specified index.

setOptionProperty

public void setOptionProperty(int optionIndex,
                              java.lang.String key,
                              java.lang.String value)
Sets a property value of the option at the specified index.

Parameters:
optionIndex - The index to check.
key - The property key.
value - The property value.

getOptionInputType

public int getOptionInputType(int optionIndex)
Returns the type of the input descriptor for the option at the specified index.

Parameters:
optionIndex - The index to check.
Returns:
The type of the input descriptor for the option at the specified index.

getOptionInputValue

public java.lang.String getOptionInputValue(int optionIndex)
Returns the value of the input descriptor for the option at the specified index.

Parameters:
optionIndex - The index to check.
Returns:
The value of the input descriptor for the option at the specified index.

setOptionFileInput

public void setOptionFileInput(int optionIndex,
                               java.lang.String path)
Sets the input descriptor to a resource at the specified path for the option at the specified index.

Parameters:
optionIndex - The index to set.
path - The path of the resource describing the option input.

setOptionCustomInput

public void setOptionCustomInput(int optionIndex,
                                 java.lang.String customData)
Sets a custom input descriptor for the option at the specified index.

Parameters:
optionIndex - The index to set.
customData - The data describing the option input.

getParameterNames

public java.lang.String[] getParameterNames()
Returns the names of the parameters that will be returned from the interaction.

Returns:
The names of the parameters that will be returned from the interaction.

getParameterValues

public java.lang.String[] getParameterValues(java.lang.String name)
Returns the values of a parameter to be set when the process resumes.

Parameters:
name - The name of the parameter to be set.
Returns:
The values that specified parameter will be set to.

setParameterValues

public void setParameterValues(java.lang.String name,
                               java.lang.String[] values)
Configures a parameter set when the current process resumes.

Parameters:
name - The name of the parameter to set.
values - The values to set the parameter to.

exportContents

public java.lang.Object exportContents()
Description copied from interface: ICommand
Exports the contents of this command to a simple structure of arrays and serializable values from java.lang.

Returns:
A serializable structure this command can be re-constituted from.

importContents

public void importContents(java.lang.Object contents)
Description copied from interface: ICommand
Configures the contents of this command with a structure previously returned from ICommand.exportContents().

Parameters:
contents - The exported contents structure to load from.